﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataExtractionLanguage
{
    /// <summary>
    /// Must be implemented by a scanner object to supply input to the parser.
    /// </summary>
    public interface ILexical
    {
        /// <summary>
        /// Gets value determines if there is another token to move on.
        /// </summary>
        /// <returns>false if positioned beyond tokens</returns>
        bool Advance { get; }

        /// <summary>
        /// Classifies current token.
        /// Should not be called if Advance returned false.
        /// </summary>
        /// <remarks>Current token or single character.</remarks>
        TokenTypeEnum Token();

        /// <summary>
        /// Gets the last read token.
        /// </summary>
        TokenTypeEnum TokenType { get; }

        /// <summary>
        /// Associated with current token.
        /// Should not be called if Advance() returned false.
        /// </summary>
        /// <remarks>Value for token()</remarks>
        object Value { get; }

        /// <summary>
        /// Gets current location of the scanning source.
        /// </summary>
        Location Location { get; }
    }
}
